package com.bjdd.jdy.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/4/13.
 */

public class ToolBean {

    /**
     * toolId : 1
     * toolName : 电瓶车
     * enable : true
     */

    private int toolId;
    private String toolName;
    private boolean enable;

    public static ToolBean objectFromData(String str) {

        return new Gson().fromJson(str, ToolBean.class);
    }

    public static List<ToolBean> arrayToolBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<ToolBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getToolId() {
        return toolId;
    }

    public void setToolId(int toolId) {
        this.toolId = toolId;
    }

    public String getToolName() {
        return toolName;
    }

    public void setToolName(String toolName) {
        this.toolName = toolName;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }
}
